import cPickle
import gzip

class Serializer:
    def serialize(self, object, out_name):
        f = gzip.open(out_name, 'wb')
        cPickle.dump(object, f)
        f.close()
    
    def unserialize(self, in_name):
        f = gzip.open(in_name, 'rb')
        obj = cPickle.load(f)
        f.close()
        return obj
